/**
 * @desc 引入样式
 * */
import '@/style/index.less';

/**
 * @desc 插件安装
 * */
import '@/plugins';

import VConsole from 'vconsole';
import {IOS_COMMAND, postMessage} from '@/utils/postMessage';

postMessage(IOS_COMMAND.GET_TOKEN);
if (process.env.NODE_ENV !== "production") {
  new VConsole();
}

window.receiveTokenHandle = (data: string) => {
  const tokenData: TokenStatus = JSON.parse(data);
  const {token} = tokenData;
  sessionStorage.setItem('token', token);
  console.log('token:', token);
};

window.receiveRoomIdHandle = (data: string) => {
  const IdData: IDStatus = JSON.parse(data);
  const {room_id} = IdData;
  sessionStorage.setItem('room_id', room_id);
  console.log('room_id:', room_id);
};
